<template>
    <div class="rights">
        <el-table ref="singleTable" :data="tableData" highlight-current-row
            style="width: 100%">
            <el-table-column type="index">
            </el-table-column>
            <el-table-column property="authName" label="权限管理">
            </el-table-column>
            <el-table-column property="path" label="路径">
            </el-table-column>
            <el-table-column property="level" label="权限等级">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.level==0">一级</el-tag>
                  <el-tag v-if="scope.row.level==1" type="success">二级</el-tag>
                  <el-tag v-if="scope.row.level==2" type="warning">三级</el-tag>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
import {getrights} from "../utils/rights"
export default {
    data() {
        return {
            tableData:[]
        }
    },
    methods: {
        getDatarights(){
            getrights().then(res=>{
                console.log(28,res);
                this.tableData=res.data
            })
        }
    },
    created() {
        this.getDatarights()
    },
    mounted() {

    },
    components: {

    },
    computed: {

    },
    watch: {

    },
}
</script>

<style lang='scss' scoped>
.rights {
    width: 100%;
    background-color: #fff;
    padding: 10px;
    box-sizing: border-box;
}
</style>
